package com.adobe.growl.tests
{
	import flexunit.framework.TestCase;
	import com.adobe.growl.Header;
	import com.adobe.growl.MessageBuilder;
	import com.adobe.growl.HeaderItem;

	public class HeaderTest extends TestCase
	{
		public function HeaderTest(methodName:String=null)
		{
			super(methodName);
		}
		
		private var name:String = "fooName";
		private var value:String = "fooValue";
		
		public function testConstructor():void
		{
			var header:Header = new Header(name, value);
			
			assertEquals("header.name == name", header.name, name);
			assertEquals("header.value == value", header.value, value);
		}
		
		public function testName():void
		{
			var header:Header = new Header();
				header.name = name;
				
			assertEquals("header.name == name", header.name, name);
		}
		
		public function testValue():void
		{
			var header:Header = new Header();
				header.value = value;
				
			assertEquals("header.value == value", header.value, value);
		}
		
		public function testPoly():void
		{			
			var header:Header = new Header(name, value);
			
			assertTrue("header is HeaderItem", (header is HeaderItem));
		}
		
		public function testToString():void
		{
			var header:Header = new Header(name, value);
			
			var output:String = name + Header.NAME_VALUE_SEPERATOR + value + MessageBuilder.EOL;
			
			assertEquals("header.toString() == output", header.toString(), output);
		}
	
	}
}